#ifndef XKIT_COLLECTIONS_ARRAY_H
#define XKIT_COLLECTIONS_ARRAY_H

#include "../ref.h"
#include <stdbool.h>

typedef struct ArrayHeader {
    Reference *ref;
    size_t length;
    losu_object *value;
} ArrayHeader;

ArrayHeader *ArrayInit(losu_vm_t vm, size_t size);
void ArrayFree(losu_vm_t vm, ArrayHeader *h);
void ArraySet(losu_vm_t vm, ArrayHeader *h, size_t index, losu_object_t o);
void ArrayFill(losu_vm_t vm, ArrayHeader *h, losu_object_t o);
bool ArrayGet(losu_vm_t vm, ArrayHeader *h, size_t index, losu_object_t target);

#endif
